﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BooksManagement
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Registered registered = new Registered();
            registered.Show();
            this.Hide();

        }

        Login login = new Login();

        //登录
        private void button1_Click(object sender, EventArgs e)
        {
            var uase = textBox1.Text;
            var pwd = textBox2.Text;

            var sql = string.Format("select* from Users where Useername = '{0}' and Password = '{1}'", uase, pwd);
            var dt = Means.GetTheData(sql);

            if (dt.Rows.Count==1)
            {
                MessageBox.Show("登录成功！", "提示");
                this.Hide();
                login.Show();
            }
            else
            {
                MessageBox.Show("登录失败！", "提示");
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }


    }
}
